// 测试 cz_std 模块
const cz_std = @import("src/cz_std.zig");

pub fn main() !void {
    // 测试字符串比较
    const str1 = "hello";
    const str2 = "hello";
    const str3 = "world";
    
    if (cz_std.eql(str1, str2)) {
        cz_std.print("字符串相等测试通过\n", .{});
    }
    
    if (!cz_std.eql(str1, str3)) {
        cz_std.print("字符串不等测试通过\n", .{});
    }
    
    // 测试字符串查找
    if (cz_std.indexOf("hello world", "world")) |pos| {
        if (pos == 6) {
            cz_std.print("字符串查找测试通过\n", .{});
        }
    }
    
    // 测试 startsWith
    if (cz_std.startsWith("hello", "hel")) {
        cz_std.print("startsWith 测试通过\n", .{});
    }
    
    // 测试 endsWith
    if (cz_std.endsWith("hello", "llo")) {
        cz_std.print("endsWith 测试通过\n", .{});
    }
    
    // 测试整数解析
    const num = try cz_std.parseInt(i64, "12345", 10);
    if (num == 12345) {
        cz_std.print("整数解析测试通过\n", .{});
    }
    
    // 测试浮点数解析
    const fnum = try cz_std.parseFloat(f64, "123.45");
    if (fnum > 123.44 and fnum < 123.46) {
        cz_std.print("浮点数解析测试通过\n", .{});
    }
    
    cz_std.print("所有测试通过！\n", .{});
}
